package com.tc.ex;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Auther: tianchao
 * @Date: 2025/1/2 13:30
 * @Description:
 */
@RestControllerAdvice
public class MyGlobalExceptionHandler {

    Logger log = LoggerFactory.getLogger(MyGlobalExceptionHandler.class);

    @ExceptionHandler(Exception.class)
    public String handle(Exception e) {
        log.info("Exception: {}", e);
        return "Exception";
    }
}
